package com.summer.core.entity;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

import com.summer.core.common.BeanName;
/**
 * 数据库表字段映射
 * @author wwwlike
 *
 */


@Entity
@BeanName("字段")
public class Field extends BaseBean{
	
	private static final long serialVersionUID = 1L;
	//字段名
	private String name;
	//中文含义
	private String cn_name;
	//英文含义
	private String en_name;
	//字段类型 
	private String field_type;
	//字段大小
	private String var_size;
	//排序字段
	private int sort;
	
	//是否主键
	private boolean is_pk;
	
	//是否外键
	private boolean is_fk;
	
	//外键意义字段
	private String fk_name;
	
	//是否表单
	private boolean is_form;
	
	//外键对应表
	private STable fk_table;
	
//	//是否查询字段
//	private boolean is_find;
//	
//	//查询方式
//	private String findType;
	
	private STable table;
	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getCn_name() {
		return cn_name;
	}
	public void setCn_name(String cnName) {
		cn_name = cnName;
	}
	public String getEn_name() {
		return en_name;
	}
	public void setEn_name(String enName) {
		en_name = enName;
	}
	public String getField_type() {
		return field_type;
	}
	public void setField_type(String fieldType) {
		field_type = fieldType;
	}
	public String getVar_size() {
		return var_size;
	}
	public void setVar_size(String varSize) {
		var_size = varSize;
	}
	@ManyToOne(cascade=CascadeType.REFRESH,fetch = FetchType.LAZY)
	@JoinColumn(name = "tableid")
	public STable getTable() {
		return table;
	}

	public void setTable(STable table) {
		this.table = table;
	}
	public int getSort() {
		return sort;
	}
	public void setSort(int sort) {
		this.sort = sort;
	}
	public boolean isIs_pk() {
		return is_pk;
	}
	public void setIs_pk(boolean isPk) {
		is_pk = isPk;
	}
	public boolean isIs_fk() {
		return is_fk;
	}
	public void setIs_fk(boolean isFk) {
		is_fk = isFk;
	}
	public String isFk_name() {
		return fk_name;
	}
	public void setFk_name(String fkName) {
		fk_name = fkName;
	}
	public boolean isIs_form() {
		return is_form;
	}
	public void setIs_form(boolean isForm) {
		is_form = isForm;
	}
	@ManyToOne(cascade=CascadeType.REFRESH,fetch = FetchType.LAZY)
	@JoinColumn(name = "fk_tableid")
	public STable getFk_table() {
		return fk_table;
	}
	
	public void setFk_table(STable fkTable) {
		fk_table = fkTable;
	}
	
	
	
	
	

}